home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 13-07.C < prev    next >
Text File  |  1991-05-06  |  583b  |  32 lines

  1. #define ESC 27
  2.  
  3. main()
  4. {
  5.    int color;
  6.    int old_mode;
  7.    unsigned char key, aux;
  8.  
  9.    old_mode = fg_getmode();
  10.    fg_setmode(fg_automode());
  11.    color = 0;
  12.  
  13.    fg_musicb("O4 L16 CC#DD#EFF#GG#AA#B O+ CC#DD#EFF#GG#AA#B$",-1);
  14.  
  15.    while (fg_playing())
  16.    {
  17.       color = (color + 1) & 15;
  18.       fg_setcolor(color);
  19.       fg_rect(0,fg_getmaxx(),0,fg_getmaxy());
  20.  
  21.       fg_waitfor(4);
  22.       fg_intkey(&key,&aux);
  23.       if (key == ESC)
  24.          fg_hush();
  25.       else if (key+aux != 0)
  26.          fg_hushnext();
  27.    }
  28.  
  29.    fg_setmode(old_mode);
  30.    fg_reset();
  31. }
  32.